
import logging as logger
import json
import requests
import asyncio
import time
import threading

class Dirb():
    scan_list: list[str] = []
    target: str = ''
    def send_requests(self):
        try:
            r = requests.get(self.target , timeout=(10 ,10))
            if r.status_code == 200 or r.status_code == 403 or r.status_code == 401:
                self.scan_list.append("[+] "+str(r.status_code)+" "+self.target)
                return "[+] "+str(r.status_code)+" "+self.target
            return None
        except:
            return None


    def scan_website_dir(self ,target):
        dict_list = open('./dic.txt').readlines()
        for i in dict_list:
            
            self.target = target  + i
            t = threading.Thread(target=self.send_requests)
            t.start()

        print("hello world")
        time.sleep(12)
        return '\n'.join(self.scan_list)
        

d = Dirb()
print(d.scan_website_dir("http://127.0.0.1"))